﻿using Com.Lancetinc.Evs.Communications;
using Com.Lancetinc.Evs.Models;

namespace Com.Lancetinc.Evs
{
    public class ActiveApp
    {
        public static ActiveApp Instance = new();

        private readonly InstrumentManager _instManager;

        public InstrumentManager InstManager => _instManager;

        public IInstrumentState Instrument => _instManager.Instrument;

        public MainWindowViewModel MainWindowVm { get; set; }

        public string GetEndoscopicTypeCode()
        {
            if (Instrument.EndoscopicConnected)
            {
                return Helpers.AppConfigHelper.GetTypeCodeByHcSerialNo(Instrument.HcSerialNo);
            }
            return null;
        }

        private ActiveApp()
        {
            this._instManager = new InstrumentManager();
        }
    }
}
